<?php
//démarrage de la session 
session_start();

$pathPear = '/librairies/pear';
set_include_path(realpath(dirname(__FILE__)) . $pathPear);
//set_include_path(get_include_path() . PATH_SEPARATOR . $pathPear);
//print_r(get_include_path());exit;

require realpath(dirname(__FILE__)).'/application/parametrage/parametre.php';
require realpath(dirname(__FILE__)).'/librairies/smarty/libs/Smarty.class.php';

// instanciation de Smarty
$smarty = new Smarty();
$smarty->template_dir = './application/templates/';
$smarty->compile_dir = './application/templates_c/';
$smarty->config_dir = './application/configs/';
$smarty->cache_dir = './application/cache/';
$smarty->compile_check = true;

error_reporting(E_ALL);
ini_set('display_errors', 'Off');

// Connexion à la base de données via Pear
require_once $pathPear . '/MDB2/MDB2.php';

$mdb2 = & MDB2::factory($dsn);

if (PEAR::isError($mdb2)) {
    echo ($mdb2->getMessage() . ' - ' . $mdb2->getUserinfo());
}
?>
